﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SecurityApi.Business;
using SecurityApi.DataAccess;

namespace SecurityApi.UnitTest
{
    [TestClass]
    public class PasswordUnitTest
    {

        [TestCategory("Password")]
        [TestMethod]
        public void UpdateUserPasswordTest()
        {
            string userName = @"user1@codeplex.com";
            string password = @"T@p$ecret2010";
            string salt = string.Empty;
            int enterpriseId = 1;
            UserManager mgr = new UserManager();
            bool bResult = mgr.UpdatePasswordInformation(userName, password, out salt, enterpriseId);

        }

        [TestCategory("Password")]
        [TestMethod]
        public void VerifyUserPasswordTest()
        {
            string userName = @"user1@codeplex.com";
            string password = @"T@p$ecret2010";
            int enterpriseId = 1;
            UserManager mgr = new UserManager();
            bool bResult = mgr.VerifyPassword(userName, password, enterpriseId);
        }

        [TestCategory("Password")]
        [TestMethod]
        public void VerifyUserWrongPasswordTest()
        {
            string userName = @"user1@codeplex.com";
            string password = @"dunno";
            int enterpriseId = 1;
            UserManager mgr = new UserManager();
            bool bResult = mgr.VerifyPassword(userName, password, enterpriseId);
        }

        [TestCategory("Password")]
        [TestMethod]
        public void GeneratePasswordTest()
        {
            PasswordHelper mgr = new PasswordHelper();
            string tempPassword = mgr.GeneratePassword();
        }

    }
}
